package com.car.service.Impl;

import com.car.entity.Cartable;
import com.car.mapper.CartableMapper;
import com.car.page.Page;
import com.car.service.CartableService;
import com.car.vo.CartableVo;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class CartableServiceImpl implements CartableService{
	@Autowired
	CartableMapper mapper;

	@Override
	public int deleteByPrimaryKey(Integer carId) {
		// TODO Auto-generated method stub
		return 0;
	}

	
	
	public int insert(CartableVo record) {
		// TODO Auto-generated method stub
		return mapper.insert(record);
	}

	@Override
	public Cartable selectByPrimaryKey(Integer carId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Cartable> selectAll() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int updateByPrimaryKey(Cartable record) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<CartableVo> selByBrandId(Cartable cartable,String qccity) {
		// TODO Auto-generated method stub
		return mapper.selByBrandId(cartable,qccity);
	}

	@Override
	public List<CartableVo> selByIdAndState(String carId, String carState) {
		// TODO Auto-generated method stub
		return mapper.selByIdAndState(carId,carState);
	}
@Override
	public CartableVo selBycarId(String carId) {
		// TODO Auto-generated method stub
		return mapper.selBycarId(carId);
	}
	@Override
	public Page<CartableVo> selectAllToInfos(Integer carId,Integer pageNo, Integer pageSize) {
		// TODO Auto-generated method stub
		Page<CartableVo> pageInfo =new Page<CartableVo>(pageNo,pageSize);
		List<CartableVo> list = mapper.selectAllToInfos(carId, (pageNo-1)*pageSize, pageSize);
		pageInfo.setTotalRow(mapper.countAllToInfos(carId, pageNo, pageSize));
		pageInfo.setList(list);
		return pageInfo;
	}}